package com.carolouvindam;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;

public class MainActivity extends Activity {
    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        ImageView splashScreen = (ImageView) findViewById(R.id.splash_image);

        splashScreen.setOnClickListener(monListenner);

    }

    private View.OnClickListener monListenner = new View.OnClickListener() {
        public void onClick(View v) {
            HelloToast();

            StartOrderActivity();
        }
    };

    private void HelloToast() {
        Context context = getApplicationContext();
        CharSequence text = "Welcome to Cake@Home !";
        int duration = Toast.LENGTH_SHORT;

        Toast toast = Toast.makeText(context, text, duration);
        toast.show();
    }

    private void StartOrderActivity() {
        Intent intent = new Intent(this, OrderActivity.class);
        startActivity(intent);
    }
}
